1. Field of the Invention
The present invention relates to the process of distributing software to mobile devices. More specifically, the present invention relates to a method and an apparatus for optimizing patching of objects containing references within mobile-computing devices.
2. Related Art
The Java 2 Platform, Micro Edition (J2ME™), has become a very popular software platform for memory-constrained devices such as wireless devices. Motorola, Nokia, NTT DoCoMo, RIM, Siemens, and many other key players in the wireless device industry have shipped a large number of J2ME-enabled devices. In fact, hundreds of millions of J2ME-enabled mobile phones have been shipped during the past few years.
Many J2ME™ environments include large machine-generated binary tables. One notable example is the system ROM image, which contains bytecodes and other metadata for JAVA™ system classes. Such tables are often large, on the order of megabytes, and sometimes need to be patched. For instance, if a bug is found in one of the system classes, the system ROM image may need to be rebuilt and then updated across a large installed base of devices. Because the bandwidth between the device and an update server may be low, transferring a new updated image to a large number of devices may take a long time.
This bandwidth problem can be reduced by sending only the difference (a “binary diff”) between the old and new images to the device. The device then converts the old image to the new image by using a “binary patching” technique. However, for an image that contains a large number of references, making even a minor change to the location of objects within the image can cause a large number of the references within the objects to change, thereby dramatically increasing the number of differences between the two images and thus increasing the size of the patch.
Hence, what is needed is a method and an apparatus for patching objects containing references without the above-described problems.